@import url(https://fonts.googleapis.com/css?family=Raleway:400,800);

figure.overlay{
	font-family: 'Raleway', sans-serif;
	position: relative;
	float: left;
	margin: 10px 1%;
	min-width: 220px;
	max-width: 310px;
	max-height: 310px;
	width: 100%
	overflow: hidden;
	text-align: center;
}

/* let's make it a smooth transition when we hover over the image */
figure.overlay * {
	-webkit-transition: all 0.35s ease-in-out;
	transition: all .35s ease-in-out;
}

figure.overlay img{
	opacity: 0.3;
	max-width: 100%;
	position: relative;
}

figure.overlay figcaption{
	position: absolute;
	top: 50%;
	left: 30px;
	right: 30px;
	/* now let's write the code that rotates the text */
	-webkit-transform: rotate(0deg) translateY(-50%) scale(1);
	transform: rotate(0deg) translateY(-50%) scale(1);
	-webkit-transform-origin: center 0;
	transform-origin: center 0;
}

figure.overlay figcaption h2{
	top: 50%;
	letter-spacing: -1px;
	color: #ffffff;
	text-transform: uyppercase;
	padding: 10px 0px;
	margin: 0;
	font-weight: 400;
}

figure.overlay figcaption h2 span{
	font-weight: 800;
}

/* for the lines above and below the figcaptions */
figure.overlay figcaption:before, figure.overlay figcaption:after{
	background-color: rgba(255, 255, 255, 0.8);
	width: 100%;
	height: 2px;
	position: absolute;
	content: "";
	display: block;
	-webkit-transition: all 0.35s ease-in-out;
	transition: all 0.35s ease-in-out;
}

figure.overlay figcaption:before{
	left: 0;
	top: 0;
}

figure.overlay figcaption:after{
	bottom: 0;
	right: 0;
}

figure.overlay.pink{
	background: #ff9999;
}

figure.overlay.purple{
	background: #e2ccff;
}

figure.overlay.green{
	background: #dfff80;
}

/* the following code is only necessary if you want to make the images links */
figure.overlay a{
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	position: absolute;
}

/* when you hover, the overlay disappears */
figure.overlay:hover img, figure.overlay.hover img{
	opacity: 1;
}

figure.overlay:hover figcaption,
figure.overlay.hover figcaption{
	-webkit-transform: rotate(-45deg) translateY(-50%) scale(0.9);
	transform: rotate(-45deg) translateY(-50%) scale(0.9)
}

figure.overlay:hover figcaption:before,
figure.overlay.hover figcaption:before,
figure.overlay:hover figcaption:after,
figure.overlay.hover figcaption:after{
	width: 200%;
}

/* note that the selectors for the code above use both the :hover pseudo-selector and the class .hover */